package com.imooc.service;


import com.imooc.pojo.*;
import com.imooc.pojo.vo.*;
import com.imooc.utils.PagedGridResult;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @Author: 逸尘风清
 * @Date: 2021/5/7
 * @Time: 22:14
 * 描述：
 */
public interface ItemService {
    public Items queryItemById(String itemId);

    public List<ItemsImg> queryItemImgList(String itemId);

    public List<ItemsSpec> queryItemsSpecList(String itemId);

    public ItemsParam queryItemsParam(String itemId);
    // 统计商品好评中评差评数量
    public CommentLevelCountsVO queryCommentCounts(String itemId);
    // 查询商品评价列表
    PagedGridResult queryPagedComments(String itemId, Integer level, Integer page, Integer pageSize);
    // 搜索商品
    PagedGridResult searchItems(String keywords, String sort, Integer page, Integer pageSize);
    // 根据商品分类查询商品
    PagedGridResult searchItemsByThirdCat(Integer catId, String sort, Integer page, Integer pageSize);
    // 根据商品规格id获取商品
    List<ShopcartVO> queryItemsBySpecIds(String itemSpecIds);

    ItemsSpec quertyItemSepcById(String itemSpecId);

    String queryItemMainImgUrlById(String itemId);

    @Transactional(propagation = Propagation.REQUIRED)
    void decreaseItemSpecStock(String itemSpecId, Integer buyCounts);
}
